<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%--
  Created by IntelliJ IDEA.
  User: 85167
  Date: 2017/12/10
  Time: 11:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <c:import url="/WEB-INF/page/header.jsp"/>
</head>
<body>
<div class="col-md-12">
    <form id="inputForm" class="form-horizontal" action="${pageContext.request.contextPath}/admin/biz/distributor/save"
          method="post">
        <input type="hidden" name="id" value="${info.id}">
        <table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
            <tbody>
            <tr>
                <td class="width-15 active"><label class="pull-right"><font color="red">*</font>上级代理ID：</label></td>
                <td class="width-35">
                    <c:if test="${info.id != null}">
                        <input id="parentId" name="parentId" class="form-control number required" type="text"
                               value="${info.parentId}"
                               aria-required="true" readonly>
                    </c:if>
                    <c:if test="${info.id == null}">
                        <c:if test="${currId != 1000}">
                            <input id="parentId" name="parentId" class="form-control number required" type="text"
                                   value="${currId}"
                                   aria-required="true" readonly>
                        </c:if>
                        <c:if test="${currId == 1000}">
                            <input id="parentId" name="parentId" class="form-control number required" type="text"
                                   value="${currId}"
                                   aria-required="true">
                        </c:if>
                    </c:if>
                </td>
                <td class="width-15 active"><label class="pull-right"><font color="red">*</font>密码：</label></td>
                <td class="width-35">
                    <input id="password" name="password" class="form-control number required" type="text"
                           value="${info.password}"
                           aria-required="true">
                </td>
            </tr>
            <tr>
                <td class="width-15 active"><label class="pull-right"><font color="red">*</font>代理商名称：</label></td>
                <td class="width-35">
                    <input id="name" name="name" class="form-control required" type="text" value="${info.name}"
                           aria-required="true">
                </td>
                <td class="width-15 active"><label class="pull-right">联系人姓名 ：</label></td>
                <td class="width-35">
                    <input id="linkMan" name="linkMan" class="form-control required" type="text"
                           value="${info.linkTel}">
                </td>
            </tr>
            <tr>
                <td class="width-15 active"><label class="pull-right">联系电话 ：</label></td>
                <td class="width-35">
                    <input id="linkTel" name="linkTel" class="form-control required" type="text"
                           value="${info.linkTel}">
                </td>

                <td class="width-15 active"><label class="pull-right">证件号码：</label></td>
                <td class="width-35">
                    <input id="idCard" name="idCard" class="form-control required" type="text" value="${info.idCard}">
                </td>
            </tr>
            <tr>
                <td class="width-15 active"><label class="pull-right">商家地址：</label></td>
                <td class="width-35">
                    <input id="address" name="address" class="form-control required" type="text"
                           value="${info.address}">
                </td>
                <td class="width-15 active"><label class="pull-right">户名：</label></td>
                <td class="width-35">
                    <input id="bankName" name="bankName" class="form-control required" type="text"
                           value="${info.bankName}">
                </td>
            </tr>
            <tr>
                <td class="width-15 active"><label class="pull-right">账户：</label></td>
                <td class="width-35">
                    <input id="bankAccount" name="bankAccount" class="form-control required" type="text"
                           value="${info.bankAccount}">
                </td>
                <td class="width-15 active"><label class="pull-right">开户行：</label></td>
                <td class="width-35">
                    <input id="bank" name="bank" class="form-control required" type="text" value="${info.bank}">
                </td>
            </tr>
            <tr>
                <td class="width-15 active"><label class="pull-right">分销比例%：</label></td>
                <td class="width-35" colspan="1">
                    <c:if test="${isSelf}">
                        <input id="rate" name="rate" class="form-control required" type="text" value="${info.rate}"
                               readonly>
                    </c:if>
                    <c:if test="${!isSelf}">
                        <input id="rate" name="rate" class="form-control required" type="text" value="${info.rate}">
                    </c:if>
                </td>
            </tr>
            <tr>
                <td class="width-15 active" style="min-width: 135px;" colspan="1"><label
                        class="pull-right">套餐类型选择：</label></td>
                <td class="width-85" colspan="3">
                    <c:forEach items="${devTypeList}" var="vo">
                        <div style="min-width: 120px;float: left;padding: 5px;">
                            <div class="checkbox i-checks" style="display:inline;">
                                <c:choose>
                                    <c:when test="${fn:contains(info.devTypeIdList,vo.id)}">
                                        <label>
                                            <input type="checkbox" name="devTypeIds[]" value="${vo.id}" checked>
                                            <i></i>${vo.name}
                                        </label>
                                    </c:when>
                                    <c:otherwise>
                                        <label>
                                            <input type="checkbox" name="devTypeIds[]" value="${vo.id}">
                                            <i></i>${vo.name}
                                        </label>
                                    </c:otherwise>
                                </c:choose>
                            </div>
                        </div>
                    </c:forEach>
                </td>
            </tr>
            </tbody>
        </table>
    </form>
</div>
<c:import url="/WEB-INF/page/footer.jsp"/>
<script>
    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    });
</script>
</body>
</html>
